using System.Collections;
using System.Collections.Generic;
using System.Globalization;

namespace DataScripter.Scripting.Compare.DataTables.Data
{
    internal class ObjectsComparer : IComparer<object[]>
    {
        private readonly Comparer _comparer = new Comparer(CultureInfo.InvariantCulture);

        public int Compare(object[] x, object[] y)
        {
            for (int index = 0; index < x.Length; index++)
            {
                object o1 = x[index];
                object o2 = y[index];

                int comparison = _comparer.Compare(o1, o2);
                if (comparison != 0)
                    return comparison;
            }
            return 0;
        }
    }
}